<!DOCTYPE html>
<html lang="en">
<head>
<title>huangliusong</title>
<script src="./vue.js"></script>
</head>
 
<body>
	<div id="app">
	{{fullName}}
	</div>

	<script type="text/javascript">
	var vm=new Vue({
		el:"#app",
		data:{
			firstName:"1",
			lastName:"2"
		},
		computed:{
			fullName:{
				get:function(){
					return this.firstName+" "+this.lastName
				},
				set:function(value){
					var arr=value.split(" ");
					this.firstName=arr[0];
					this.lastName=arr[1];
					console.log("value:"+value);
				}
			}
		}
	})
	</script>
</body>

</html>